From 51f06b796d63104f7b9051f79d63a469ef8cc8b6 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Sat, 23 Dec 2006 10:28:40 +0000 Subject: [PATCH] * Make the default messages for "undo" less intrusive, remove headings * Rename messages for "undo" to "undo-success" and "undo-failure" * Treat "undo-success" and "undo-failure" as wikitext ** Please remember that output needs to be escaped before it's sent to the browser, and be careful with message handling. ** --- includes/EditPage.php | 21 +++++++++------------ languages/messages/MessagesEn.php | 8 ++++---- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 7b08c0e8d0..7775710042 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -70,7 +70,7 @@ class EditPage { * Fetch initial editing page content. */ private function getContent() { - global $wgRequest, $wgParser; + global $wgOut, $wgRequest, $wgParser; # Get variables from query string :P $section = $wgRequest->getVal( 'section' ); @@ -116,19 +116,16 @@ class EditPage { } else { $result = true; } - - if (!$result) { - #Undoing failed. Bailing out with regular revision text. - $text = $currev_text; - - #Give a warning - $this->editFormPageTop .= "

" . wfMsg('undofailed') . "

\n" . - '

'.wfMsg('explainundofailed').'

'; + + if( $result ) { + # Inform the user of our success and set an automatic edit summary + $this->editFormPageTop .= $wgOut->parse( wfMsgNoTrans( 'undo-success' ) ); + $this->summary = wfMsgForContent( 'undo-summary', $undo, $undorev->getUserText() ); } else { - $this->editFormPageTop .= '

'.wfMsg('undosucceeded')."

\n" . - '

'.wfMsg('explainundosucceeded').'

'; - $this->summary = wfMsgForContent('undo-summary', $undo, $undorev->getUserText()); + # Warn the user that something went wrong + $this->editFormPageTop .= $wgOut->parse( wfMsgNoTrans( 'undo-failure' ) ); } + } } else if( $section != '' ) { diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 568e6a6732..6e9af9f9cc 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1012,10 +1012,10 @@ the text into a text file and save it for later.', 'nocreatetitle' => 'Page creation limited', 'nocreatetext' => 'This site has restricted the ability to create new pages. You can go back and edit an existing page, or [[Special:Userlogin|log in or create an account]].', -'undofailed' => 'Undo Failed', -'explainundofailed' => 'The edit could not be undone because of conflicting intermediate edits. Please manually undo the edits.', -'undosucceeded' => 'Undo Succeeded', -'explainundosucceeded' => 'The edit was successfully undone. Please click save to apply this change.', + +# "Undo" feature +'undo-success' => 'The edit has been undone. Please confirm, and then save the changes below.', +'undo-failure' => 'The edit could not be undone due to conflicting intermediate edits.', 'undo-summary' => 'Undo revision $1 by [[Special:Contributions/$2]] ([[User talk:$2]])', # Account creation failure -- 2.20.1